package com.mo.modular.system.warpper;

import java.util.List;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;

import com.mo.common.constant.factory.ConstantFactory;
import com.mo.config.properties.MoProperties;
import com.mo.core.base.warpper.BaseControllerWarpper;

/**
 * 图片列表的包装类
 *
 * @author chenxiaodong
 * @date 2017年2月19日10:59:02
 */
public class ImageWarpper extends BaseControllerWarpper {
	String urlMappingImgpath ;
    public ImageWarpper(List<Map<String, Object>> list,String urlMappingImgpath) {
        super(list);
        this.urlMappingImgpath= urlMappingImgpath;
    }
    @Override
    public void warpTheMap(Map<String, Object> map) {
//        map.put("pName", ConstantFactory.me().getSingleRoleName((Integer) map.get("pid")));
    	if(map!=null&&map.containsKey("file_name")){
    		map.put("file_name", urlMappingImgpath+ (map.get("file_name")==null?"":(String)map.get("file_name")));
    		map.put("compress_name", urlMappingImgpath+ (map.get("compress_name")==null?"":(String)map.get("compress_name")));
    		
    	}
    }

}
